﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace tp1
{
    public class Coordinates
    {
        private int x;
        private int y;

        public Coordinates(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        public int X
        { get { return x; } }

        public int Y
        { get { return y; } }

        public override string ToString()
        {
            return String.Format("[X = {0}, Y = {1}]", x, y);
        }

        public override bool Equals(object obj)
        {
            Coordinates coordinates = obj as Coordinates;

            if (coordinates != null)
            {
                return this.x.Equals(coordinates.x) && this.y.Equals(coordinates.y);
            }

            return false;
        }
    }
}
